1. Field of the Invention
The present invention relates to the execution of time critical processes in a computing environment. More particularly, the present invention relates to a method and apparatus for executing time critical processes in a window system environment.
2. Art Background
In the computing industry it is quite common to utilize a window system such as the SunView.TM. or NeWS.TM. XVIEW.TM. (OPEN WINDOWS.TM.) window systems (SunView.TM., XVIEW.TM., OPEN WINDOWS.TM. and NeWS.TM. are trademarks of, and are manufactured by, Sun Microsystems, Inc., Mountain View, Calif.), for displaying and controlling user input and output to an application program. The window system provides the means to generate visual user interfaces such as menus and other graphical objects. Multiple application programs can be shown and executed at the same time using windowed displays. For example, in a first window an accounting program may be operating, while in a second window a drawing program may be running. The user of the computer has the ability to switch from window to window to operate the separate programs by moving the cursor from one window to another. Furthermore, the window system controls the information displayed, the processes executing through the window system and the user input to various windows and executing processes.
The window system maintains complete control over the programs which are executing through the window system (hereinafter referred to as "application programs"). For example, the window system controls the access to hardware output devices such as video displays, printers, etc. The application programs depend upon the window system to notify the application programs of user window events. Furthermore, the window system controls the application programs such that different application programs can operate in a multi-tasking environment. In addition, the window system controls which processes of the application programs may access the CPU and the priority of access.
Typically, in a multi-tasking computing environment, each process executing is allocated a "time slice" (i.e., a predetermined period of time) to utilize the CPU. The processes execute during their respective time slices, thereby sharing the CPU. If a process has not completed execution during its time slice, the process "goes to sleep" (i.e., the process is suspended) until its next time slice. Furthermore if a user event is considered to be a blocking operation, for example, reading data from a disk, the corresponding process will be suspended until the operation is complete.
In a window system environment, the window system has the ability to intervene in the allocation of time slices and therefore can cause processes to be suspended. Hence, processes of application programs, which operate through the window system are not guaranteed access to the CPU within a predetermined amount of time because the process can be suspended for an indeterminate amount of time by the window system.
For example, the window system may need to modify the CPU time slice process allocation to perform generic window system operations such as moving a window or displaying graphics or text. Generally, this is not a problem for an application process executing through the window system. More particularly, suspension of the application process will not cause any problems except for a slight delay in the execution of the process. For example, when a user enters an unknown command, the window system displays an error message and requires the user to enter "ok" or similar acknowledgement command to proceed. While the window process waits for the user to respond, it freezes or suspends all other window processes currently executing under the window system. [For information on window systems, see, for example, Gosling, Rosenthal, Arden, The NeWS Book (1989) pp. 23-52].
The suspension of processes by the window system because of blocking operations and the like creates a problem in time critical processes of application programs executing through the window system. These time critical processes require responses and actions to be taken within specific time frames. For example, if an application program is receiving data through a modem, then the modem must receive the data to be transmitted at a certain baud rate which dictates a certain time dependency. If the time critical application program is suspended by the window system, then the modem cannot receive the data at the utilized baud rate, and the modem cannot operate properly. More particularly, if the modem is connected to a Unix.RTM. base system (Unix is a registered trademark of AT&T), while the time critical application program is currently accessing the modem to receive data and the time critical application program is suspended by the window system, the data received through the modem will go to a buffer located in the operating system kernel. The operating system will then attempt to transfer the information received from the modem to the application program. However, if the application program is suspended, the data cannot be transferred and the data will remain in the buffer. If the suspension continues, the buffer eventually becomes full and the data is lost due to a serial overrun. [For further information on the Unix system and Unix kernel, see Bach, The Design of the Unix Operating System (1986)].
This problem may be avoided by modifying the window system to not suspend time critical processes. However, most window systems are standardized such that the window system cannot be changed and all application programs written to operate in conjunction with the window system must adhere to the strict window system interface.